package com.feonix.common.view.grid;

import com.feonix.common.util.StringUtil;

public class GridCell {

	protected String field = "";

	protected String value = "";

	protected String onClick = "";

	protected boolean disabled = false;

	protected boolean escape = true;

	protected String tip = "";

	public GridCell(String field, String value, String onClick) {
		this.field = field;
		this.value = value;
		this.onClick = onClick;
	}

	public GridCell(String field, String value, String onClick, boolean escape) {
		this.field = field;
		this.value = value;
		this.onClick = onClick;
		this.escape = escape;
	}

	public String getField() {
		return this.field;
	}

	public String getValue() {
		return this.value;
	}

	public String getOnClick() {
		return this.onClick;
	}

	public boolean isEscape() {
		return this.escape;
	}

	public boolean isDisabled() {
		return this.disabled;
	}

	public GridCell setDisabled(boolean disabled) {
		this.disabled = disabled;
		return this;
	}

	public String getTip() {
		if (StringUtil.isEmpty(this.tip)) {
			this.tip = StringUtil.getSafeString(this.value, true);
		}
		return this.tip;
	}

	public GridCell setTip(String paramString) {
		this.tip = paramString;
		return this;
	}
}
